Method and Apparatus for a High-Speed Frame Tagger

ABSTRACT

A method is described including extracting protocol information from a received packet within a framer, comparing the protocol information in a first pass to predetermined values to produce a first result, and tagging the packet based on the set of results.

CROSS-REFERENCES RELATED TO APPLICATION

This application is a continuation application of U.S. patent application Ser. No. 12/192,318, filed Aug. 15, 2008, now U.S. Pat. No. 8,135,029, which is a continuation application of U.S. patent application Ser. No. 10/327,524, filed Dec. 20, 2002, now U.S. Pat. No. 7,420,975, both of which are hereby incorporated by reference in their entirety.

BACKGROUND

In general, networks and computers operate in different manners. Networks operate by transferring data in streams and/or packets. Streams may be bit-sized, byte-sized, or otherwise broken down. Packets may be of relatively large size, such as 64, 512, or more bytes each. Computers operate by processing data, typically in well-defined small sizes, such as bytes (8 bits), words (16 bits), double words (32 bits), and so on. At the interface between a computer and a network, a translation or reorganization of data may be necessary. This may include reorganizing data from a series of packets into a format useful to a processor. In particular, this may include taking data bits of a series of bytes and reorganizing them into a form including only data bits. A similar problem may occur at a byte-level, wherein some bytes of a group of bytes are data bytes, and other bytes are effectively control bytes which need to be parsed out of data.

Determining which bytes received are control or data bytes often is the function of a network processor within a system, which is also charged with the task of processing all data bytes. As data bytes tend to be the largest portion of network traffic, the network processor has a heavy workload within the system. Moreover, network processors typically do not run at line speed (the speed at which data is transferred) when processing because of the heavy workload from processing data along with the demand to determine what type of control or data bytes are received.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is illustrated by way of example and not limitation in the accompanying figures;

FIG. 1 illustrates an embodiment of a system in block diagram form;

FIG. 2 illustrates an embodiment of a frame tag apparatus in block diagram form;

FIG. 3 illustrates an alternate embodiment of a frame tag apparatus in block diagram form;

FIG. 4 illustrates another alternate embodiment of a frame tag apparatus in block diagram form;

FIG. 5 illustrates an embodiment of a method of frame tagging in flow diagram form;

FIG. 6 illustrates an alternate embodiment of a method of frame tagging in flow diagram form; and

FIG. 7 illustrates another alternate embodiment of a method of frame tagging in flow diagram form.

DETAILED DESCRIPTION

A method and apparatus for a high-speed frame tagger is described. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the invention. It will be apparent, however, to one skilled in the art that the invention can be practiced without these specific details. In other instances, structures and devices are shown in block diagram form in order to avoid obscuring the invention.

Reference in the specification to “one embodiment” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the disclosure. The appearances of the phrase “in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments.

Various descriptions of this document relate to devices or components being coupled together. Coupling typically denotes a relationship allowing for communication or connection between a first and second object. The first object may be directly connected to the second object. Alternatively, the first object may be directly connected to a third object which may also be directly connected to the second object, thereby achieving a coupling between the first object and the second object. As will be appreciated, the number of intermediate objects between two objects which are coupled together does not determine whether the objects are coupled, the presence of a link between the two objects indicates that the two objects are coupled together.

In general, the disclosure relates in various embodiments to a method or apparatus for a multi-pass comparison of contents of a packet to various single or multiple predetermined values. The comparison may be implemented such that comparisons to early words in the packet (first words of a protocol section of a packet, for example) determine whether later words need to be compared. However, the comparisons may be carried out in parallel or nearly parallel (as words arrive), such that the delay involved is not one clock cycle per word compared, for example.

In one embodiment, a method includes extracting protocol information from a received packet within a framer. The method also includes comparing the protocol information in a first pass to predetermined values to produce a first result. The method further includes tagging the packet based on the first result.

The method may further include determining an offset within the packet at which the protocol information may be found. The method may also include skipping a number of bytes within the packet corresponding to the offset to find the protocol information. The method may further include comparing the protocol information in a second pass to predetermined values to produce a second result. The first and second results form a set of results, and the tagging is based on the set of results.

In an alternate embodiment, an apparatus includes a network processor interface suitable for coupling to a network processor. The apparatus further includes a central processor interface suitable for coupling to a central processor. The apparatus also includes a protocol determination logic block to determine a protocol type of data in a packet and steer the packet to either the central processor interface or the network processor interface based on the protocol type of data.

The protocol logic block may also include a protocol extractor to extract a location of protocol information of the packet. The protocol logic block may further include a data register to store protocol information of the packet. The protocol logic block may also include a comparator to compare contents of the data register to predetermined values. The protocol logic block may further include a tag selector to select a tag based on a result of the comparator. The protocol logic block may also include a protocol code memory to store the predetermined values.

Furthermore, the network processor interface, central processor interface, and protocol determination logic block may be included in a framer. The apparatus may also include a central processor coupled to the central processor interface of the framer. The apparatus may further include a network processor coupled to the network processor interface of the framer. The apparatus may also include a physical link layer coupled to the framer. The apparatus may further include a software stack coupled to the framer. The apparatus may also include a host system coupled to the software stack and the network processor.

In another alternate embodiment, an apparatus includes means for extracting protocol information from a received packet within a framer. The apparatus also includes means for comparing the protocol information in a first pass to predetermined values to produce a first result. The apparatus further includes means for tagging the packet based on the first result.

Illustrations of various embodiments of the invention are provided, but the illustrations of the figures described are not limiting on the invention, so much as they exemplify some embodiments of the invention. FIG. 1 illustrates an embodiment of a system in block diagram form. Data is received and sent on line 110, which may be a fiber optic cable or twisted-pair copper wire, for example. Coupled to line 110 is physical layer 120, which translates signals from line 110 into a form suitable for use by circuitry, such as through optoelectronic transformation or level-shifting, for example. Coupled to physical layer 120 is framer 130, which operates to frame or deframe data for transmission or reception, and which includes frame tag module 135. Coupled to framer 130 is network processor 140, which may be used to process data for transmission or reception. Coupled to network processor 140 is host system 170, which may transfer data between network processor 140 and a network interface 180 which couples to an internal network. Also coupled to framer 130 is processor 150, which may operate to control framer 130 and interact with frame tag module 135. Furthermore, coupled to both framer 130 and host system 170 is software stack 160, which may be used to store control packets for handling by host system 170.

In one embodiment, framer 130 may be expected to use frame tag module 135 to tag incoming packets, and then framer 130 may be expected to steer those packets to particular destinations depending on the tags from frame tag module 135. Alternatively, frame tag module 135 may generate tags which are passed on to network processor 140. Network processor 140 may then use those tags to determine what type of packet they accompany.

FIG. 2 illustrates an embodiment of a frame tag apparatus in block diagram form. In one embodiment, data is received, examined at line speed by high-speed dedicated logic, tagged based on results of this examination, and then the tags and the data are provided to a network processor for further processing. Frame tag module 200 is illustrated, including physical interface 210, protocol detection 220, tag select 230, network processor interface 240, and processor interface 250. Preferably, physical interface 210 receives data from a physical link layer component. Similarly, preferably network processor interface 240 provides data to a network processor within a surrounding system. However, these interfaces may be incorporated within a larger component such as a framer, of which frame tag module 200 is only a part. Moreover, the results of the frame tag module 200 operations may be used within a component rather than provided directly to an external component, such that tags discussed below may be used in a framer to steer data elsewhere, rather than sending the tags to a network processor, for example.

Protocol detection 220 is a logic block including dedicated logic which determines what type of bytes (control, data, and various subclassifications) is being received. The output of this logic is used by tag select 230 to determine which tags should accompany the data. Preferably, the tags are predetermined values of one to several bits which may be used within the system to indicate a specific type of information in a packet, such as a control packet for use by a host system or a data packet for use in transporting data. Moreover, in some embodiments, tag select 230 also includes route selection logic which determines what data path should be used by a packet as it traverses within the component or within the system as a whole.

Each of protocol detection 220 and tag select 230 are controlled in part through processor interface 250. In one embodiment, processor interface 250 is suitable for coupling to a processor which controls a framer and other parts of a line card but does not actually process data itself. In alternate embodiments, other control devices, such as a host system processor, may be coupled to the processor interface 250 to control some aspects of operation of the protocol detection 220 and tag select 230 logic blocks. Processor interface 250 may be used to supply control codes to protocol detection 220, and these control codes may then be compared to values found in received packets to determine the type of packets. Similarly, processor interface 250 may be used to supply tag values to tag select 230, and these tag values may then be used throughout the system to identify the type of a packet.

Various different implementations of a frame tag module may be used. FIG. 3 illustrates an alternate embodiment of a frame tag apparatus in block diagram form. In this embodiment, protocol data is extracted from a packet at line speed, the protocol data is placed in a register, and the protocol data is compared to predetermined values. Based on results of the comparison, the packet is then tagged as belonging to a certain type of packets, such as control or data packets, for example.

Frame tag module 300 includes protocol extractor 310, data register 320, comparator 330, tag selector 340, and control block 350. Control block 350 controls operations of each of protocol extractor 310, data register 320, comparator 330, and tag selector 340. The protocol extractor, in one embodiment, examines a packet to determine a location of protocol information within the packet and then extracts that protocol information from the packet. In turn, the protocol information is stored in data register 320, allowing for easy access to the protocol information by comparator 330. Comparator 330 compares the protocol information with predetermined values and indicates if any of the predetermined values match the protocol information. Tag selector 340 uses the indication from comparator 330 to determine which tag should be applied to the packet, and that tag is then available for any components which receive the packet after its use by the frame tag module 300.

Predetermined values used by the comparator 330 may be provided by control block 350, or through an interface (not shown) with another component. Similarly, the tags provided by tag selector 340 may be provided to tag selector 340 from control block 350 or through an interface (not shown) to another component. Moreover, tag selector 340 may have the larger purpose of effectively indicating which of several data paths a packet will take within a system, either based on the tag supplied, or based on specific information provided by tag selector 340 aside from a specific tag value.

A more detailed illustration of one embodiment may serve to further indicate how one may implement a high-speed frame tagger. FIG. 4 illustrates another alternate embodiment of a frame tag apparatus in block diagram form. Data is received and analyzed, with a protocol information section extracted from a packet, stored into a register, compared with predetermined (programmable) values, and then with a tag provided based on the comparison.

Packet processor interface 410 interfaces with an external component relative to the frame tagger, providing the packet upon which to operate (as payload 414) along with control signals enable 412, byte value 416, and control 418. Packet analyzer 420 receives the packet initially and provides various portions of the packet and control signals to other subcircuits. CPU register block 480 similarly provides various information and control signals to the subcircuits and interfaces through interface 404 with an external processor (not shown). First protocol processor 458 along with Nth protocol processor 468 and intermediate protocol processors each perform a process which may be similar to, or different from, processes performed by other protocol processors.

In general, each protocol processor is used to compare a word, field, or other portion of a packet to an expected value in a lookaside manner (the comparison occurs at line speed as the packet passes through). The total number of protocol processors needed for a packet passing through the interface is decided based on the number of different sets of relevant fields that need to be analyzed on the packet. The number (N) of protocol processors in a given implementation or embodiment may thus be bounded by the number of individual comparisons that will need to be performed in this manner, with each protocol processor dedicated to a preselected comparison or set of comparisons. Moreover, the comparisons may need to be altered, depending on the type of packet encountered, such that a protocol processor may perform a first type of comparison for a first type of packet and a second type of comparison for a second type of packet. In some embodiments, this may be implemented by having the protocol processor always perform all potential comparisons.

First protocol processor 458 is described further herein, and other protocol processors may be understood as similar. Protocol extractor 440 receives payload 422, enable 424, byte value 426, and offset control signals 428 and uses these signals and data to extract a protocol information section from the payload 422. Protocol extractor 440 also receives offset value 476 from protocol offset register 490. This protocol information section will have a predetermined number of bytes (which may be encoded in the packet or fixed). The bytes (or words) of the protocol information section are provided separately as data 1 signal 444 through data n signal 448, along with corresponding enable signals 442 through 446.

Protocol register 450 receives the signals/data from protocol extractor 440 and maintains this information for use by comparator 460 under the control of packet analyzer 420 (through enable 430, start 432, and channel number 434 signals). Protocol register 450 may be implemented to have different storage areas for different channels or virtual channels, depending on how the surrounding system is expected to perform.

Comparator 460, responsive to start signal 436, compares the data available from protocol register 450 (available as byte value 1 452 through byte value n 454 and protocol word 456 signals) to expected or predetermined values, either single values or a set of values for each word/byte. Comparator 460 also receives priority indication 478 from priority detection logic 492 and receives protocol word 482 and protocol mask 484 from protocol word and mask register 494. In one embodiment, protocol mask 484 and protocol word 482 allow for a selective comparison of the data from protocol register 450 to the protocol word 482 (the predetermined value).

Tag and route selection 470 receives results from comparator 460, which may include tag 462 (the tag selected for the packet), enable signal 464 (indicating the comparison is complete), and error signal 466. Error signal 466 may be a 1 bit or larger signal indicative of some form of error prior to use of any data by tag and route selection 470, and may thus be used to pass along an indication that the established tag may not be reliable. Tag and route selection 470 also receives default tag enable signal 438 (which enables a default tag if no other tag is appropriate), default tag signal 486 from default tag register 496 (the storage location for the default tag value), along with router bit 488 from tag router bit storage location 498. Tag and route selection 470 use the tag signal(s) that are a result of comparator 460 to determine where a packet should be routed to (which data path, for example) and what the tag for the packet should be. Enable signal 472 and tag and router selection signal 474 are then made available to other components as a signal indicating a useful result (enable 472) and the actual tag and route selection for the packet (tag and router signal 474).

As various embodiments of apparatuses may be used, various methods of practicing the invention may be carried out. FIG. 5 illustrates an embodiment of a method of frame tagging in flow diagram form. In general, the embodiment involves an initial check of the packet, finding protocol information, checking the protocol information, and then assigning a tag based on results of the previous parts of the method.

At block 510, a data packet is received. Preferably, the method occurs in parallel with reception of the packet. Moreover, while a packet may be referred to as having data or control information, all packets may be referred to in some sense as data packets, as all packets may be treated the same (as a packet containing data to be transferred) in some parts of any communications system. Thus, as the method occurs, portions of the packet initially received at block 510 may continue to be received. If the method operates at line speed with the data, then this will likely be the case.

At block 520, the length of the packet is checked. If it is a very short packet, checking its type on the fly may not be possible in some embodiments, and the process moves to block 560, where a default tag is assigned. Typically, a default tag may be an indication that the contents of the packet have not been determined, rather than an indication of a specific type of packet. If the packet is of sufficient length to be checked, the process moves to block 530, and the offset bytes (initial bytes in a packet prior to protocol information) are skipped. At block 540, the actual protocol information is checked against predetermined values. If no match is found, the packet type has not been determined, and the process proceeds to block 560.

If a match has been found at block 540, a second-pass comparison may be necessary. At block 550, a second-pass comparison (such as checking an additional part of the protocol information beyond that checked at block 540, for example) occurs. If a match is found at block 550, then at block 580 a tag appropriate to the matches at both blocks 540 and 550 is assigned. If no match is found at block 550, then a tag appropriate to the match at block 540 and lack of a match at block 550 is assigned at block 570. From blocks 560, 570, and 580, the method proceeds to transfer of data at block 590, wherein the packet and any associated tags are provided to components associated with a system using the method of this embodiment.

Various alternative methods may also be implemented, including methods utilizing more parallelism than is literally illustrated with respect to FIG. 5. FIG. 6 illustrates an alternate embodiment of a method of frame tagging in flow diagram form. In general, the method attempts to perform multiple comparisons in parallel, thus matching a packet to an expected protocol of a group of expected protocols. However, the method also hierarchically compares portions of a packet such that if the highest priority comparison (such as a first-pass comparison, for example) fails, the other comparisons do not affect the result.

At block 600, the first-pass protocol word of a packet is extracted. At block 620, this first-pass protocol word is compared with a user-defined or predetermined protocol value, to determine whether the first-pass protocol word of the packet matches an expected value. If not, the type of packet is not one that is being scanned for, and at block 630, the packet is tagged as a default packet, and the process moves to block 690, where the detected tag is made available.

If the first-pass protocol word is a match (either to a single value or to one of a set of values), then parallel portions of the method come into play. At block 610, the second-pass protocol word is extracted, and at block 640, the second-pass protocol word is compared to a user-defined or predetermined protocol value, to determine whether the second-pass protocol word of the packet matches an expected value. If no match is found, at block 650, this is acknowledged as a match for the first pass and no match for the second pass. Correspondingly, at block 660, the tag appropriate for the first-pass match is provided, and the process then proceeds to block 690. If a match occurs at block 640, the process moves to block 670, and the process recognizes that both the first and second passes had matches. Then, at block 680, the tag appropriate to the second-pass match is provided as the applicable tag. Ultimately, regardless of the comparison results, the process ends for a given packet at block 690.

As indicated, the matches available for a given pass may be a single predetermined or programmed value, or one of a set of values. Thus, a range of values may be specified for a given pass. Typically, each word to be compared from the packet will be in a compact portion of the packet, such that the various words to be compared will be available nearly simultaneously. However, the process works by using the first matches to trigger use of later matches such that if the first-pass protocol word of the packet does not match, the tag is the default tag, regardless of potential matches in the second-pass protocol word. This may be varied, if appropriate.

Examination of FIG. 6 will allow one to envision a multiple pass comparison beyond two passes. FIG. 7 illustrates another alternate embodiment of a method of frame tagging in flow diagram form. The embodiment of FIG. 7 provides for n passes of comparison, each having some control over “succeeding” passes without requiring a delay from one pass to the next.

At block 710, the first-pass protocol word of a packet is extracted. At block 715, this first-pass protocol word is compared with a user-defined or predetermined protocol value to determine whether the first-pass protocol word of the packet matches an expected value. If not, the type of packet is not one that is being scanned for, and at block 720, the packet is tagged as a default packet.

If the first-pass protocol word is a match, then parallel portions of the method come into play. At block 725, the second-pass protocol word is extracted, and at block 730, the second-pass protocol word is compared to a user-defined or predetermined protocol value to determine whether the second-pass protocol word of the packet matches an expected value. If no match is found, at block 735, this is acknowledged as a match for the first pass and no match for the second pass. Correspondingly, at block 745, the tag appropriate for the first-pass match is provided.

If a match occurs at block 730, this is recognized at block 740, and the process moves, potentially, along to blocks 760 and 770. In the meantime, at block 750, an nth-pass protocol word is extracted from the packet, and at block 755, a determination is made as to whether a match to the nth-pass protocol word has occurred. Any number of passes may thus be implemented. In the nth pass, block 760 is used to recognize that no match on pass n occurred, and that the pass n−1 tag should be used at block ° 765. Likewise, at block 770, recognition of matches on all passes occurs, and the pass n tag of block 775 is used. Ultimately, regardless of the comparison results, the process ends for a given packet at block 780, with the appropriate tag (of blocks 720, 745, 765, 775 or other blocks not illustrated in FIG. 7) made available as a result of the process.

In the foregoing detailed description, the methods and apparatuses of the present disclosure have been described with reference to specific representative embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the present invention. In particular, the separate blocks of the various block diagrams represent functional blocks of methods or apparatuses and are not necessarily indicative of physical or logical separations or of an order of operation inherent in the spirit and scope of the present invention. For example, the various blocks of FIG. 4 may be integrated into components or may be subdivided into components. Similarly, the blocks of FIG. 5 (for example) represent portions of a method which, in some embodiments, may be reordered or may be organized in parallel rather than in a linear or step-wise fashion. The present specification and figures are, accordingly, to be regarded as illustrative rather than restrictive. 

1-19. (canceled)
 20. A computer-implemented method comprising: extracting protocol information from plural portions of a received packet within a framer; performing a hierarchical comparison of the extracted protocol information with expected protocol values; and assigning a tag to the packet based on the hierarchical comparison.
 21. The method of claim 20, wherein the hierarchical comparison is priority-based.
 22. The method of claim 20, wherein the hierarchical comparison comprises: performing a first-priority comparison of first extracted protocol information from a first portion of the packet; and performing a second-priority comparison of second extracted protocol information from a second portion of the packet.
 23. The method of claim 22, wherein the first-priority comparison indicates no match for the first extracted protocol information, and wherein the tag comprises a default tag.
 24. The method of claim 23, wherein the default tag is assigned independent of the result of the second-priority comparison.
 25. The method of claim 22, wherein the first-priority comparison indicates a match for the first extracted protocol information, and wherein the tag varies based on the result of the second-priority comparison.
 26. The method of claim 20, wherein the hierarchical comparison comprises: performing a first-priority comparison of first extracted protocol information from a first portion of the packet; and performing plural lower-priority comparisons of additional extracted protocol information from additional portions of the packet.
 27. The method of claim 26, wherein the first-priority comparison indicates no match for the first extracted protocol information, and wherein the tag comprises a default tag.
 28. The method of claim 27, wherein the default tag is assigned independent of the results of the plural lower-priority comparisons.
 29. The method of claim 26, wherein the first-priority comparison indicates a match for the first extracted protocol information, and wherein the tag varies based on the results of the plural lower-priority comparisons.
 30. An apparatus comprising: a network processor interface; a central processor interface; a protocol determination logic block configured to determine a protocol type of data in a packet, wherein the protocol determination logic block includes a comparator configured to perform hierarchical comparisons of protocol information in plural portions the packet with expected protocol values; and a tag select logic block configured to apply a tag to the packet indicating that the packet should be sent to either the central processor interface or the network processor interface based on the protocol type of data.
 31. The apparatus of claim 30, wherein the protocol determination logic block includes a data register configured to store the protocol information of the packet.
 32. The apparatus of claim 30, wherein the protocol determination logic block includes a tag selector configured to select a tag based on a result of the comparator.
 33. The apparatus of claim 30, wherein the protocol determination logic block includes a protocol code memory configured to store the expected protocol values.
 34. The apparatus of claim 30, wherein the network processor interface, central processor interface, and the protocol determination logic block reside in a framer.
 35. The apparatus of claim 34, further comprising a central processor coupled to the central processor interface of the framer.
 36. The apparatus of claim 35, further comprising a network processor coupled to the network processor interface of the framer.
 37. The apparatus of claim 36, further comprising a physical link layer coupled to the framer.
 38. The apparatus of claim 37, further comprising a software stack coupled to the framer.
 39. The apparatus of claim 38, further comprising a host system coupled to the software stack and the network processor.
 40. An apparatus comprising: means for extracting protocol information from plural portions of a received packet within a framer; means for comparing the protocol information in a first pass to predetermined values to produce a first result; means for tagging the packet based on the first result if the first result is negative; and means for comparing the protocol information in a second pass to predetermined values, if the first result is positive, to produce a second result, wherein the first and second results form a set of results.
 41. The apparatus of claim 40, further comprising means for comparing the protocol information in a third pass to predetermined values to produce a third result of the set of results. 